package com.xuexiang.xui_lib.component.textview.marqueen;

import ohos.agp.components.AttrHelper;
import ohos.agp.components.Text;
import ohos.app.Context;

/**
 * 简单字幕
 */
public class SimpleNoticeMF extends MarqueeFactory<Text, String> {
    private Context context;

    public SimpleNoticeMF(Context context) {
        super(context);
        this.context = context;
    }

    @Override
    public Text generateMarqueeItemView(String data) {
        Text view = new Text(context);
        view.setTextSize(AttrHelper.fp2px(15, context));
        view.setPadding(AttrHelper.vp2px(10, context), AttrHelper.vp2px(10, context), AttrHelper.vp2px(10, context), AttrHelper.vp2px(10, context));
        view.setText(data);
        return view;
    }
}